import request from '@/utils/request'

// get 编辑区列表数据
export function getBlockList(params) {
  return request({
    url: '/ops/block/list',
    method: 'get',
    params
  })
}

// get 编辑区编辑数据
export function getBlockTemplate(blockId, tenantId) {
  return request({
    url: '/ops/blockTemplate/list',
    method: 'get',
    params: {blockId: blockId, tenantId: tenantId}
  })
}

// get 编辑区历史记录数据
export function getBlockHistory(blockId, tenantId) {
  return request({
    url: '/ops/blockHistory/list',
    method: 'get',
    params: {blockId: blockId, tenantId: tenantId}
  })
}

// post 保存编辑区模板数据
export function saveBlockTemplate(data) {
  return request({
    url: '/ops/blockTemplate/update',
    method: 'post',
    data
  })
}

// post 重置编辑区模板数据
export function recoveryBlockTemplate(data) {
  return request({
    url: '/ops/blockHistory/recovery',
    method: 'post',
    data
  })
}
